/* 实现debounce */
function debounce(fn, wait) {
  let timer = null;
  return function () {
    clearTimeout(timer);
    timer = setTimeout(() => {
      fn.call(this, arguments)
    }, wait)
  }
}


function say() {
  console.log('debounce');
}
window.addEventListener("resize", debounce(say, 500));